package com.rou.im.framework.boot.starter.postprocessor;

import com.rou.im.framework.boot.starter.builder.ProcessorStackBuilder;
import com.rou.im.framework.core.processorstack.ProcessorStack;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * <p></p>
 *
 * @author GaoShuangWen
 * @since 2020-05-26 15:32
 */
/*@Configuration
@Import(ObjectPostProcessorConfiguration.class)
public class ProcessorStackConfiguration {

    private ObjectPostProcessor<Object> objectPostProcessor;

    @Autowired(required = false)
    private ProcessorStackConfigurerAdapter adapter;

    @Autowired
    public void setObjectPostProcessor(ObjectPostProcessor<Object> objectPostProcessor) {
        this.objectPostProcessor = objectPostProcessor;
    }

    @Bean(name ="ProcessorStack")
    public ProcessorStack processorStack() throws Exception {
        ProcessorStackBuilder builder = objectPostProcessor
                .postProcess(new ProcessorStackBuilder(objectPostProcessor));
       return builder.build();
    }

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ProcessorStackConfiguration.class);
        ProcessorStackBuilder bean = context.getBean(ProcessorStackBuilder.class);
        System.out.println(bean);
    }




}*/
